:root {
  --ol-control-radius: 100px;
  --blur5: blur(5px) !important;
  --blur10: blur(10px);
}

/* SELF */
.self-info.compact {
  align-items: baseline;
  justify-content: space-between;
  text-shadow: 2px 2px 3px var(--background-transp);
}

.self-info.compact, .self-info.compact #self-info__name {
  position: initial;
  padding-left: 5px;
}

.self-info__entry:has(#self-info__coord) {
  width: initial;
}

#self-info__name.debug::before {
  content: '🟢 ';
  font-size: xx-small;
  position: relative;
  top: -2.5px;
  left: -2.5px;
}

#self-info__name.break::before {
  content: '🔴 ';
}

#self-info__coord, .sbgcui_speed {
  font-family: 'Consolas', monospace
}

/* PROFILE */

.profile.popup button:not(.popup-close) {
  min-height: 30px;
}

/* BADGES */

.eui-badge-container {
  display: none;
}


/* POPUPS */

.popup {
  border-radius: 5px;
}

.info.popup {
  padding-bottom: 5px !important;
  padding-left: 0;
  padding-right: 0;
}

/* BUTTONS */
.ol-control #settings {
  margin-top: 20px;
}

.bottomleft-container > button, body > #layers {
  min-width: 40px;
  min-height: 40px;
}

.game-menu > button {
  z-index: 1;
}

.game-menu > button, button#ops, #attack-menu, body>#layers {
  text-transform: uppercase;
}

.popup-close[data-round=true], #inventory__close[data-round=true] {
  font-weight: 600 !important;
  border: 2px solid !important;
  border-color: #777;
  border-radius: 100px !important;
  font-size: 1.5em !important;
  height: 2em !important;
  width: 2em !important;
  padding: 0 !important;
  box-shadow: unset;
}

#inventory__close:not([data-round=true]) {
  min-height: 35px;
}

/* FIX BUTTON ABSOLUTE POSITIONS */ /* TODO: make all buttons absolute (except info)*/
.settings.popup .popup-close[data-round=true] ,
.profile.popup .popup-close[data-round=true] ,
.notifs.popup .popup-close[data-round=true] {
  position: absolute;
  bottom: 1em;
  align-self: center;
}

.inventory__content {
  padding-bottom: 6em;
}

.pr-stats {
  padding-bottom: 3em;
}

.settings-content, 
.notifs__list {
  padding-bottom: 5em;
}

.splide__arrow {
  height: 3em;
  width: 3em;
  border: 1px solid #777;
  border-radius: 100px;
  background: revert;
}

.splide__arrow svg {
  fill: var(--text);
}

#discover:not([data-time]) .discover-progress,
.info.popup.hidden .discover-progress {
  display: none;
}

#eui-repair {
  filter: inherit;
  transition: all ease-in-out 50ms;
}

#eui-repair:active {
  filter: opacity(0.75);
  transition: all ease-in-out 50ms;
}

.discover-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 2px;
  background-color: #7777;
  filter: opacity(0.75);
  transition: width 1s linear;
}

.i-buttons>button,
.attack-slider-buttons>button,
.draw-slider-buttons>button:not(.fa) {
  position: relative;
}

/* ATTACK SLIDER */

#catalysers-list > .splide__slide {
  min-width: max-content !important;
  width: 100px !important;
}

#attack-slider {
  border-radius: 10px;
  padding: 2px;
}

#attack-slider .splide__arrows {
  display: none;
}

/* DEPLOY SLIDER */

#cores-list > .splide__slide {
  min-width: max-content !important;
  width: 80px !important;
}


/* DRAW LINE SLIDER */

.refs-list__image>div {
  border-radius: 5px;
}

.draw-slider-wrp .splide__slide {
  width: calc(((75% + 1em) / 2) - 1em) !important;
  max-width: 200px;
  transition: all 0.2s ease-in-out;
}

.draw-slider-wrp .splide__slide.is-active {
  transition: all 0.2s ease-in-out;
}

.draw-slider-wrp .draw-slider-buttons:not(.fa) {
  justify-content: center;
}

.draw-slider-wrp .draw-slider-buttons button:not(.fa) {
  padding: 6px;
  text-transform: uppercase;
}

/* POINT INFO */

/* Info popup image fixes */
.i-header {
  border-bottom-style: hidden;
  z-index: 1;
}

#i-title {
  color: #fff !important;
  display: block;
  overflow: hidden;
  /* text-wrap: balance; */
  text-overflow: ellipsis;
  text-shadow: 0 0 2px var(--text-shadow), 0 0 2px var(--text-shadow), 0 0 2px var(--text-shadow), 0 0 2px var(--text-shadow);
  filter: drop-shadow(2px 4px 6px var(--text-shadow));
  white-space: nowrap;
  margin: 0 5px;
}

.i-image-box {
  margin-top: -32px;
  min-height: 150px !important;
}

#i-level, .sbgcui_point_star {
  margin-top: 25px;
}

.i-buttons {
  order: 1;
  margin: 0 0 0.5em;
  display: flex !important;
  gap: 0.25em !important;
  width: 100% !important;
}

.i-buttons>button {
  padding: 6px 2px;
  min-width: fit-content;
  min-height: 45px;
  width: 30%;
  flex-basis: unset !important;
}

.i-buttons>button[disabled] {
  filter: opacity(0.75);
}

#discover {
  width: calc(90% + 0.5em);
  order: 1 !important;
}

#discover[data-time]:after {
  color: var(--text);
  width: 30%;
  left: 0;
  transform: translate(0%, 110%);
  direction: ltr;
}

.i-stat {
  flex-direction: row;
  flex-wrap: wrap;
  align-content: space-around;

  grid-template-areas:
    "distance lines"
    "owner regions"
    "energy reward"
    "cores cores"
    "slider slider"
    "buttons buttons" !important;
}

.i-stat__entry:not(.i-stat__cores) {
  margin: 0 5px;
  min-width: 45%;
}

.i-stat__cores {
  margin-bottom: 0.5em;
  padding: 5px 0;
  grid-template-columns: minmax(0, 2.5fr) 1fr 1fr minmax(0, 2.5fr);
  width: inherit;
}

.deploy-slider-wrp {
  width: inherit;
}

@keyframes blink {
  50% {
    box-shadow: 0px 0px 2px 2px transparent;
  }
}

.i-stat__core-info {
  margin: 5px 0;
}

.i-stat__core {
  border-width: 1px;
  border-radius: 100px;
  width: 2em;
  height: 2em;
  line-height: 2em;
  box-shadow: 0px 0px 2px 2px transparent;
  transition: box-shadow 0.25s ease-in-out;
}

.i-stat__core.selected {
  border-width: 2px;
  border-color: var(--sbgcui-branding-color, var(--selection));
  box-shadow: 0px 0px 2px 2px var(--sbgcui-branding-color, var(--selection));
  animation: blink 2s linear infinite;
}

.deploy-slider-error {
  border-radius: 5px;
}


/* SETTINGS */
.settings-section__item {
  min-height: 2em;
  align-items: center;
  margin: 2px 0;
}

.settings-section__item span {
  justify-self: unset !important;
}

.settings-section__item select,
.settings-section__item>button:not(.popup-close) {
  min-height: 25px;
  width: 100%;
  font-weight: bold;
}

input[type='range']  {
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  padding: 0;
  min-height: 25px;
  max-width: 100px;
  background: #7777;
  border-radius: 3px;
  border: none !important;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  border: 0px solid transparent;
  height: 16px;
  width: 16px;
  border-radius: 3px;
  background: var(--sbgcui-branding-color, var(--selection));
  box-shadow: -250px 0 0 250px var(--sbgcui-branding-color, var(--selection));
  cursor: pointer;
}

input[type='range']::-moz-range-thumb {
  border: 0px solid transparent;
  height: 16px;
  width: 16px;
  border-radius: 3px;
  background: var(--sbgcui-branding-color, var(--selection));
  box-shadow: -250px 0 0 250px var(--sbgcui-branding-color, var(--selection));
  cursor: pointer;
}

/* INVENTORY */

.inventory__tab {
  display: flex;
  align-items: center;
  height: 35px;
}

#inventory-delete-section {
  margin-right: 0;
}

.inventory__controls, .inventory__ma-buttons>button {
  min-height: 40px;
}

.inventory__ma-counter>button {
  min-height: 35px;
  min-width: 35px;
}

.inventory__ma-counter input {
  min-height: 30px;
  min-width: 35px;
}

.inventory__controls select,
.inventory__controls input {
  min-width: 50px;
  width: 100%;
}

/* material-symbols-outlined */
.material-symbols-outlined {
  line-height: normal !important;
  font-weight: normal !important;
}

.inventory__ic-manage::before, .inventory__ic-view::before {
  content: '' !important;
  display: block;
  background-color: currentColor;
  min-width: 20px;
  width: 100%;
  min-height: 20px;
  height: 100%;
  -webkit-mask-image: var(--icon) !important;
  mask-image: var(--icon) !important;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  line-height: 1;
}

.inventory__ic-view::before {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path fill="currentColor" d="M480.091-333.77q60.966 0 103.552-42.677 42.587-42.677 42.587-103.644 0-60.966-42.677-103.552-42.677-42.587-103.644-42.587-60.966 0-103.552 42.677-42.587 42.677-42.587 103.644 0 60.966 42.677 103.552 42.677 42.587 103.644 42.587Zm.004-51.845q-39.287 0-66.883-27.502-27.597-27.501-27.597-66.788 0-39.287 27.502-66.883 27.501-27.597 66.788-27.597 39.287 0 66.883 27.501 27.597 27.502 27.597 66.789 0 39.287-27.501 66.883-27.502 27.597-66.789 27.597Zm-.04 167.152q-131.65 0-239.583-71.653Q132.54-361.77 78.424-480q54.116-118.23 161.993-189.884 107.878-71.653 239.528-71.653 131.65 0 239.583 71.653Q827.46-598.23 881.576-480 827.46-361.77 719.583-290.116q-107.878 71.653-239.528 71.653Z"/></svg>')
}

.inventory__ic-manage::before {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path fill="currentColor" d="M402.115-342.886 480.5-421.27l78.385 78.384 34.729-34.729L515.23-456l78.384-78.385-34.729-34.729L480.5-490.73l-78.385-78.384-34.729 34.729L445.77-456l-78.384 78.385 34.729 34.729Zm-75.383 170.808q-25.5 0-42.885-17.385-17.384-17.384-17.384-42.884v-461.23h-47.192v-47.96h166.344v-41.769h189.577v41.769h166.345v47.96h-47.192v461.23q0 25.5-17.385 42.884-17.384 17.385-42.884 17.385H326.732Z"/></svg>')
}

input[data-type="reference-search"] {
  padding: 0 6px;
}

.zen {
  filter: opacity(0.75)
}

.zen::after {
  border-radius: 50% !important;
  animation: flicker 2s linear infinite;
}

.bottom-container>button {
  padding: 6px;
}

.bottom-container>button#notifs-menu {
  margin: initial;
}

.compactview_icon {
  position: relative;
}

.compactview_icon::before {
  content: '' !important;
  display: block;
  background-color: currentColor;
  min-width: 20px;
  width: 100%;
  min-height: 20px;
  height: 100%;
  -webkit-mask-image: var(--icon) !important;
  mask-image: var(--icon) !important;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  line-height: 1;
}

#leaderboard {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path fill="currentColor" d="m387-412 35-114-92-74h114l36-112 36 112h114l-93 74 35 114-92-71-93 71ZM240-40v-309q-38-42-59-96t-21-115q0-134 93-227t227-93q134 0 227 93t93 227q0 61-21 115t-59 96v309l-240-80-240 80Zm240-280q100 0 170-70t70-170q0-100-70-170t-170-70q-100 0-170 70t-70 170q0 100 70 170t170 70Z"/></svg>')
}

#score {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path fill="currentColor" d="M80-120v-480h220v480H80Zm290 0v-720h220v720H370Zm290 0v-400h220v400H660Z"/></svg>')
}

#settings {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path fill="currentColor" d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z"/></svg>')
}

#notifs-menu.compactview_icon::before {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path fill="currentColor" d="M160-200v-80h80v-280q0-83 50-147.5T420-792v-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820v28q80 20 130 84.5T720-560v280h80v80H160ZM480-80q-33 0-56.5-23.5T400-160h160q0 33-23.5 56.5T480-80Z"/></svg>');
  min-width: 20px !important;
  background: currentColor !important;
  transform: none !important;
  position: unset !important;
}

#notifs-menu[data-count].compactview_icon::after {
  content: '' !important;
  position: absolute;
  top: 5px;
  right: 0;
  background: var(--accent);
  border-radius: 50%;
  width: 25%;
  min-width: 10px;
  height: 25%;
  min-height: 10px;
  font-size: 10px;
}

#layers {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path fill="currentColor" d="M480-118 120-398l66-50 294 228 294-228 66 50-360 280Zm0-202L120-600l360-280 360 280-360 280Z"/></svg>')
}

#toggle-follow {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path fill="currentColor" d="M440-42v-80q-125-14-214.5-103.5T122-440H42v-80h80q14-125 103.5-214.5T440-838v-80h80v80q125 14 214.5 103.5T838-520h80v80h-80q-14 125-103.5 214.5T520-122v80h-80Zm40-158q116 0 198-82t82-198q0-116-82-198t-198-82q-116 0-198 82t-82 198q0 116 82 198t198 82Zm0-120q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47Z"/></svg>')
}

/* Notifs fix */
#notifs-menu[data-count]::before {
  font-family: 'Manrope', sans-serif !important;
  font-size: small;
}

/*
 * OL
 */
.ol-layer__player {
  filter: drop-shadow(2px 2px 4px var(--shadow));
}

/* 
 * SBG CUI Compatibility: enhancements and support 
 */

/* Speed z-index fix */
.sbgcui_speed {
  z-index: 1;
}

/* When compact mode height == 0  */
.game-menu > button.fa {
  min-height: 18px;
}

/* Attack button enhancements */
#attack-menu, .topleft-container {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none;
}

#attack-menu {
  border-style: double !important;
  border-top-style: solid !important;
  transition: all ease-in-out .25s !important;
  -moz-transform: rotate(0deg) !important; /* Revert Firefox desktop fix */
}

#attack-menu.sbgcui_attack-menu-rotate {
  border-bottom-style: solid !important;
  border-top-style: double !important;
  height: 5em !important;
  width: 5em !important;
  margin-top: 1em;
}

/* TODO: removed CUI sort until it has the same sort speed */
.sbgcui_refs-sort-button, .sbgcui_refs-sort-select {
  display: none !important;
}
/*.sbgcui_refs-sort-button {
  position: static;
  height: revert;
  width: revert;
  color: revert;
  background-color: revert;
  border: 1px solid #777;
  border-radius: 2px;
  box-shadow: revert;
  min-width: 30px;
  font-size: 1em;
}*/

/* Linear gradient for energy amount */
.inventory__content[data-tab="3"] .inventory__item.loaded .inventory__item-left::before {
  background: linear-gradient(90deg, #fff0 0%, var(--sbgcui-branding-color) 100%) !important;
}

/* Replace 'R' button symbol with '⚡' emoji symbol */
:root {
  --sbgcui-display-r-button: none;
}

.inventory__content[data-tab="3"] .inventory__item-controls::after {
  display: var(--sbgcui-display-r-button);
  content: '⚡' !important;
}

.catalysers-list__level, .cores-list__level {
  border-radius: 10px;
  padding: 5px;
}

@keyframes blink-box-shadow-inset {
  0% {
    box-shadow: inset 0px 2px 5px 2px;
  }

  25% {
    box-shadow: inset -2px 0px 5px 2px;
  }

  50% {
    box-shadow: inset 0px -2px 5px 2px;
  }

  75% {
    box-shadow: inset 2px 0px 5px 2px;
  }
}

#catalysers-list>.splide__slide.is-active>.catalysers-list__level, #cores-list>.splide__slide.is-active>.cores-list__level {
  box-shadow: inset 0px 2px 5px 2px;
  animation: 1.5s linear infinite blink-box-shadow-inset;
}
/* Cores should be round */
.cores-list__level {
  border-radius: 100px;
}

/* Estimated lifetime */
#i-stat__energy>span {
  font-size: small;
  font-weight: bold;
}

.info.popup>.popup-close {
  position: relative !important;
}